import 'babel-polyfill'
import React from 'react'
import "normalize.css"
import "./main.less"
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { Router,browserHistory } from 'react-router'
import App from './containers/App'
import store from './store/configureStore'
// import createHistory from 'history/lib/createHashHistory'




// const rootRoute = [{
//     path: '/',
//     component: require('./containers/App'),
//     childRoutes: [
//       require('./routes/Customers'),
//     ],
//     onEnter:function(nextState, replaceState){
//       // if(nextState.location.pathname=="/"){
//       //   replaceState(null, '/customers')
//       // }
//     }
//   }]



  const rootRoute = {
    component: 'div',
    childRoutes: [ {
      path: '/',
      component: App,
      childRoutes: [
        ...require('./routes/PropertyRoutes'),
        ...require('./routes/CustomerRoutes')
      ]
    } ]
  }



render(
  (<Provider store={store}>
    <Router history={browserHistory} routes={rootRoute} />
  </Provider>),
  document.getElementById('root')
)
